
  {% case site.comments.provider %}
    {% when 'disqus' %}
      {% if site.comments.disqus %}
          <div id="disqus_thread"></div>
          <script>
            var disqus_config = function () {
              this.page=this.page||{};
              this.page.url = document.location.href.replace(document.location.host,'{{ site.domain }}');
              this.page.identifier = '{{ page.url }}';
              this.page.title = '{{ page.title }}';
            };
            (function() { // DON'T EDIT BELOW THIS LINE
              var d = document, s = d.createElement('script');

              s.type = 'text/javascript';
              s.async = true;
              var shortname = '{{ site.comments.disqus.sitename }}';

              s.src = '//' + shortname + '.disqus.com/embed.js';

              s.setAttribute('data-timestamp', +new Date());
              (d.head || d.body).appendChild(s);
            })();
          </script>
          <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>

      {% endif %}
    {% when 'duoshuo' %}
      {% if site.comments.duoshuo %}
      <!-- Duoshuo Comment BEGIN -->
      <!-- 多说评论框 BEGIN -->
      <div class="ds-thread" data-thread-key="{{ page.url }}" data-title="{{ page.title }}" data-url="{{ site.url }}{{ page.url }}"></div>
      <!-- 多说评论框 END -->
      <!-- 多说公共JS代码 BEGIN (一个网页只需插入一次) -->
      <script type="text/javascript">
      var duoshuoQuery = {short_name:"{{ site.comments.duoshuo.sitename }}"};
        (function() {
          var ds = document.createElement('script');
          ds.type = 'text/javascript';ds.async = true;
          ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
          ds.charset = 'UTF-8';
          (document.getElementsByTagName('head')[0]
           || document.getElementsByTagName('body')[0]).appendChild(ds);
        })();
        </script>
      <!-- 多说公共JS代码 END -->
      <!-- Duoshuo Comment END -->
      {% endif %}
    {% when 'changyan' %}
      {% if site.comments.changyan %}
      <!-- Changyan Comment BEGIN -->
      <div id="SOHUCS" sid="{{ page.url }}"></div>
      <script type="text/javascript">
      (function(){
        var appid = '{{ site.comments.changyan.appid }}';
        var conf = '{{site.comments.changyan.conf}}';
        if (window.screen.width < 960) {
          window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="http://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
        } else {
          var loadJs=function(d,a){var c=document.getElementsByTagName("head")[0]||document.head||document.documentElement;var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("charset","UTF-8");b.setAttribute("src",d);if(typeof a==="function"){if(window.attachEvent){b.onreadystatechange=function(){var e=b.readyState;if(e==="loaded"||e==="complete"){b.onreadystatechange=null;a()}}}else{b.onload=a}}c.appendChild(b)};loadJs("http://changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})});
        }
      })();
      </script>
      <!-- Changyan Comment END -->
      {% endif %}
  {% endcase %}
